package com.bookstore.utils;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class Md5Utils {

	public static String createMd5String(String object) throws NoSuchAlgorithmException {
		MessageDigest messageDigest = MessageDigest.getInstance("MD5");
		byte[] buffer = messageDigest.digest(object.getBytes());
		StringBuffer stringBuffer = new StringBuffer();
		for(int i = 0; i < buffer.length; i ++) {
			stringBuffer.append(buffer[i]);
		}
		return stringBuffer.toString();
	}
}
